|
|
|
|
|
|
|
In addition, you can also use the button argument to see which mouse button was clicked, and respond differently for each variation. For instance, you might want to let the user move the data by clicking the right mouse button. |
|
|
|
|
|
|
|
|
Enhancing the Application with OLE |
|
|
|
|
|
|
|
|
Now that you have an understanding of what OLE drag and drop can do, how it works, and the events and methods you can use, you are going to add this capability to the address book application that you have been creating. Start by opening the address book project and display the frmMain form. The functions that you are going to add will enable the user to drag a name from the Tree View control to one of three icons on the toolbar to perform the following actions: |
|
|
|
|
|
|
|
|
Display the selected entry in the data entry form. |
|
|
|
|
|
|
|
|
Delete the selected entry. |
|
|
|
|
|
|
|
|
Print the entry using Crystal Reports. |
|
|
|
|
|
|
|
|
The first step is to add the three PictureBox controls to the toolbar as shown in Figure 15.2 and set the properties that are listed in Table 15.7. |
|
|
|
|
|
|
|
|
Figure 15.2
Adding the icons to the toolbar for the OLE drag-and-drop functionality. |
|
|
|
|
|